/**
 * Copyright (C), 2015-2020, 东华云计算有限公司
 * FileName: MybatisPlusConfig
 * Author:   Hezeyu
 * Date:     2020/5/7 14:46
 * Description: 分页配置类
 * History:
 * <author>          <time>          <version>         <desc>
 * HeZeyu           2020/5/7 14:46   0              分页配置类
 */
package com.example.spring.security.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * 〈分页配置类〉
 *
 * @author Hezeyu
 * @create 2020/5/7
 * @since 1.0.0
 */
@Configuration
//@MapperScan("com.dhcc.iot.mapper")
public class MybatisPlusConfig {
    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        // 开启 count 的 join 优化,只针对 left join !!!
        return new PaginationInterceptor().setCountSqlParser(new JsqlParserCountOptimize(true));
    }
}
